<template>
	<view style="height: 750rpx;">
		<view class="u-card-wrap">
			<u-card :sub-title="form.createTime" :showFoot="false" sub-title-size="22" style="height: 750rpx;">
				<view slot="body">
					<view>
						<view>
							{{form.content}}
						</view>
					</view>
				</view>
			</u-card>
		</view>
		<view>
			<u-row gutter="16">
				<u-col span="4">
					<view class="button">
						<u-tag text="删除" type="primary" shape="circleRight" @click="deleteItem"></u-tag>
						<!-- 						<u-button size="medium" type="primary" :ripple="true" shape="circle" @click="addItems">删除</u-button> -->
					</view>
				</u-col>
				<u-col span="4">
					<view>
					</view>
				</u-col>
			</u-row>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {

		data() {
			return {
				form: {}
			}
		},
		methods: {
			deleteItem() {
				this.$u.delete('/recently/' + this.form.id).then(res => {
					this.$refs.uToast.show({
						title: '删除成功',
						type: 'success',
						duration: 500,
						callback: () => {
							console.info("callback")
							this.form = ''
							uni.switchTab({
								url: '/pages/index/index',
							})
						},
					})
				})
			},
			getById(id) {
				this.$u.get('/recently/' + id).then(res => {
					this.form = res.data.item
				})
			}
		},
		onLoad(id) {
			this.getById(id.id)
		}
	}
</script>

<style lang="scss" scoped>
	.button {}

	.u-card-wrap {
		padding-right: 0px;
		padding-left: 0px;
		padding-top: 1px;
		padding-bottom: 1px;
		background-color: $u-bg-color;
	}

	.u-body-item {
		font-size: 22rpx;
		color: #333;
	}
</style>
